<?php
/**
 * created by zzy
 * date: 2017/10/24 9:28
 */

namespace App\Eloquent\Ygt;

class ProcessFieldCategory extends DbEloquent{

    protected $table    = 'ygt_process_field_category';
    public static $tableFieldList = [
        ['name'=>'id','title'=>'','value'=>0,'is_must'=>0],
        ['name'=>'company_id','title'=>'登录用户异常','value'=>0,'is_must'=>1],
        ['name'=>'title','title'=>'名称','value'=>'','is_must'=>1],
    ];

    public static function edit($data,$pk='')
    {
        $id             = isset($data['id']) ? intval($data['id']) : 0;
        if($id){
            unset($data['id']);
            $where      = ['id'=>$id];
            $result     = self::updateOneData($where,$data,$pk);
        }else{
            $result     = self::insertOneData($data,$pk);
        }
        return $result;
    }
    public static function getRows($where)
    {
        $fields         = 'id,title';
        $result         = self::getList($where,$fields);
        return $result;
    }
}
